const path = require('path')
let url = 'http://ww.baidu.com/aaa/bbb/index.html'
let str1 = path.extname(url)
console.log(str1)
let str2 = path.basename(url, str1)
console.log(str2)